import instance from "@/util/request";

// 查询活动分页列表
export function listActivity(params){
    return instance({
        url:'/activity/page',
        method:'get',
        params
    })
}

// 添加活动
export function addActivity(data){
    return instance({
        url:'/activity/add',
        method:'post',
        data
    })
}

// 修改活动
export function editActivity(data){
    return instance({
        url:'/activity/update',
        method:'put',
        data
    })
}

// 删除活动
export function removeActivity(id){
    return instance({
        url:`/activity/delete/${id}`,
        method:'put'
    })
}

// 发布活动
export function pubActivity(id){
    return instance({
        url:`/activity/publish/${id}`,
        method:'put'
    })
}

// 关闭活动
export function closeActivity(id){
    return instance({
        url:`/activity/close/${id}`,
        method:'put'
    })
}

// 查看活动详情
export function detailActivity(id){
    return instance({
        url:`/activity/detail/${id}`,
        method:'get'
    })
}

// 查询活动选项列表
export function optionActivity(){
    return instance({
        url:'/activity/list',
        method:'get'
    })
}
